package com.brayan.melinxa.logic.factories;


import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.InjectionPoint;

import org.apache.log4j.Logger;


/**
 * This is the log factory for the Logger injection. It is needed to be created,
 * since every Logger depends on its owning class. E.g. Logger log =
 * Logger.getLogger(MyClass.class.getName());
 * 
 * @author Brayan
 * 
 */
public class LogFactory {

	@Produces
	public Logger createLogger(InjectionPoint injectionPoint) {
		// below replaces: Logger log =
		// Logger.getLogger(MyClass.class.getName());
		return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName());
	}
}
